﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace de.codingfreaks.libs.cfDateTime.Test
{
    /// <summary>
    /// Contains test-methods for the <see cref="Extensions"/>-class.
    /// </summary>
    [TestClass]
    public class ExtensionTest
    {

        #region member vars

        private TestContext m_tconThis;

        #endregion

        #region constructor

        public ExtensionTest()
        {
        }

        #endregion

        #region properties

        /// <summary>
        /// Gets/sets informations about the current test and its state.        
        ///</summary>
        public TestContext TestContext
        {
            get { return m_tconThis; }
            set { m_tconThis = value; }
        }

        #endregion

        #region tests
        
        /// <summary>
        /// Test the extension-method WeekOfYear which extends the <c>DateTime</c>-type.
        /// </summary>
        [TestMethod,
         Description("Test the extension-method WeekOfYear.")]
        public void WeekNumberTest()
        {
            Assert.AreEqual(53, new DateTime(2009, 12, 31).WeekOfYear());
            Assert.AreEqual(1, new DateTime(2010, 1, 6).WeekOfYear());
            Assert.AreEqual(10, new DateTime(2012, 3, 6).WeekOfYear());
        }

        #endregion

    }
}
